home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue38 / Clinic / NoCloseForm.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1998-06-24  |  589 b   |  32 lines

  1. unit NoCloseForm;
  2.  
  3. interface
  4.  
  5. uses
  6.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  7.   StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Label1: TLabel;
  12.     procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  13.   private
  14.     { Private declarations }
  15.   public
  16.     { Public declarations }
  17.   end;
  18.  
  19. var
  20.   Form1: TForm1;
  21.  
  22. implementation
  23.  
  24. {$R *.DFM}
  25.  
  26. procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
  27. begin
  28.   CanClose := MessageDlg('Allow form to close?', mtConfirmation, [mbYes, mbNo], 0) = mrYes
  29. end;
  30.  
  31. end.
  32.